import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: HomeView,
        children: [
            // ====================== 以下是【首页】的路由配置 ======================
            {
                path: '/sys-admin/index',
                component: () => import('../views/sys-admin/SystemAdminIndex.vue')
            },
            // ====================== 以下是【商品管理】的路由配置 ======================
            {
                path: '/sys-admin/product/spu-management',
                component: () => import('../views/sys-admin/product/SpuManagement.vue')
            },
            {
                path: '/sys-admin/product/spu-management/sku-list',
                component: () => import('../views/sys-admin/product/SkuListView.vue')
            },
            {
                path: '/sys-admin/product/spu/add-new-1',
                component: () => import('../views/sys-admin/product/SpuAddNewView1.vue')
            },
            {
                path: '/sys-admin/product/spu/add-new-2',
                component: () => import('../views/sys-admin/product/SpuAddNewView2.vue')
            },
            {
                path: '/sys-admin/product/spu/add-new-3',
                component: () => import('../views/sys-admin/product/SpuAddNewView3.vue')
            },
            {
                path: '/sys-admin/product/spu/add-new-4',
                component: () => import('../views/sys-admin/product/SpuAddNewView4.vue')
            },

            {
                path: '/sys-admin/product/brands/add-new',
                component: () => import('../views/sys-admin/product/BrandAddNewView.vue')
            },
            {
                path: '/sys-admin/product/brands',
                component: () => import('../views/sys-admin/product/BrandListView.vue')
            },
            {
                path: '/sys-admin/product/albums/add-new',
                component: () => import('../views/sys-admin/product/AlbumAddNewView.vue')
            },
            {
                path: '/sys-admin/product/albums',
                component: () => import('../views/sys-admin/product/AlbumListView.vue')
            },
            {
                path: '/sys-admin/product/albums/picture-list',
                component: () => import('../views/sys-admin/product/AlbumPictureListView.vue')
            },
            {
                path: '/sys-admin/product/categories',
                component: () => import('../views/sys-admin/product/CategoryListView.vue')
            },
            {
                path: '/sys-admin/product/categories/add-new',
                component: () => import('../views/sys-admin/product/CategoryAddNewView.vue')
            },
            {
                path: '/sys-admin/product/attribute-templates/add-new',
                component: () => import('../views/sys-admin/product/AttributeTemplateAddNewView.vue')
            },
            {
                path: '/sys-admin/product/attribute-templates',
                component: () => import('../views/sys-admin/product/AttributeTemplateListView.vue')
            },
            {
                path: '/sys-admin/product/attribute/add-new',
                component: () => import('../views/sys-admin/product/AttributeAddNewView.vue')
            },
            {
                path: '/sys-admin/product/attribute',
                component: () => import('../views/sys-admin/product/AttributeListView.vue')
            },
            // ======================== 权限管理 ========================
            {
                path: '/sys-admin/permission/admin/add-new',
                component: () => import('../views/sys-admin/permission/AdminAddNewView')
            },
            {
                path: '/sys-admin/permission/admin',
                component: () => import('../views/sys-admin/permission/AdminListView')
            },
        ]
    },
    {
        path: '/about',
        component: () => import('../views/AboutView.vue')
    },
    {
        path: '/login',
        component: () => import('../views/LoginView.vue')
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
